/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.jjsoft.celularessuc.gco.mdl;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author javila
 */
@Entity
@Table(catalog = "celularessuccom", schema = "public")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Mensualidad.findAll", query = "SELECT m FROM Mensualidad m"),
    @NamedQuery(name = "Mensualidad.findByIdMensualidad", query = "SELECT m FROM Mensualidad m WHERE m.idMensualidad = :idMensualidad"),
    @NamedQuery(name = "Mensualidad.findByNumpago", query = "SELECT m FROM Mensualidad m WHERE m.numpago = :numpago"),
    @NamedQuery(name = "Mensualidad.findByFechaPago", query = "SELECT m FROM Mensualidad m WHERE m.fechaPago = :fechaPago"),
    @NamedQuery(name = "Mensualidad.findBySaldoInicial", query = "SELECT m FROM Mensualidad m WHERE m.saldoInicial = :saldoInicial"),
    @NamedQuery(name = "Mensualidad.findByInteres", query = "SELECT m FROM Mensualidad m WHERE m.interes = :interes"),
    @NamedQuery(name = "Mensualidad.findByCapital", query = "SELECT m FROM Mensualidad m WHERE m.capital = :capital"),
    @NamedQuery(name = "Mensualidad.findByCouta", query = "SELECT m FROM Mensualidad m WHERE m.couta = :couta"),
    @NamedQuery(name = "Mensualidad.findBySaldoFinal", query = "SELECT m FROM Mensualidad m WHERE m.saldoFinal = :saldoFinal"),
    @NamedQuery(name = "Mensualidad.findByPorcInteres", query = "SELECT m FROM Mensualidad m WHERE m.porcInteres = :porcInteres"),
    @NamedQuery(name = "Mensualidad.findByEstado", query = "SELECT m FROM Mensualidad m WHERE m.estado = :estado")})
public class Mensualidad implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_mensualidad", nullable = false)
    private Integer idMensualidad;
    private Integer numpago;
    @Column(name = "fecha_pago")
    @Temporal(TemporalType.DATE)
    private Date fechaPago;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "saldo_inicial", precision = 17, scale = 17)
    private Double saldoInicial;
    @Column(precision = 17, scale = 17)
    private Double interes;
    @Column(precision = 17, scale = 17)
    private Double capital;
    @Column(precision = 17, scale = 17)
    private Double couta;
    @Column(name = "saldo_final", precision = 17, scale = 17)
    private Double saldoFinal;
    @Column(name = "porc_interes", precision = 17, scale = 17)
    private Double porcInteres;
    private Boolean estado;
    @JoinColumn(name = "id_deuda", referencedColumnName = "id_deuda")
    @ManyToOne
    private DeudaCliente idDeuda;

    public Mensualidad() {
    }

    public Mensualidad(Integer idMensualidad) {
        this.idMensualidad = idMensualidad;
    }

    public Integer getIdMensualidad() {
        return idMensualidad;
    }

    public void setIdMensualidad(Integer idMensualidad) {
        this.idMensualidad = idMensualidad;
    }

    public Integer getNumPago() {
        return numpago;
    }

    public void setNumPago(Integer numpago) {
        this.numpago = numpago;
    }

    public Date getFechaPago() {
        return fechaPago;
    }

    public void setFechaPago(Date fechaPago) {
        this.fechaPago = fechaPago;
    }

    public Double getSaldoInicial() {
        return saldoInicial;
    }

    public void setSaldoInicial(Double saldoInicial) {
        this.saldoInicial = saldoInicial;
    }

    public Double getInteres() {
        return interes;
    }

    public void setInteres(Double interes) {
        this.interes = interes;
    }

    public Double getCapital() {
        return capital;
    }

    public void setCapital(Double capital) {
        this.capital = capital;
    }

    public Double getCouta() {
        return couta;
    }

    public void setCouta(Double couta) {
        this.couta = couta;
    }

    public Double getSaldoFinal() {
        return saldoFinal;
    }

    public void setSaldoFinal(Double saldoFinal) {
        this.saldoFinal = saldoFinal;
    }

    public Double getPorcInteres() {
        return porcInteres;
    }

    public void setPorcInteres(Double porcInteres) {
        this.porcInteres = porcInteres;
    }

    public Boolean getEstado() {
        return estado;
    }

    public void setEstado(Boolean estado) {
        this.estado = estado;
    }

    public DeudaCliente getIdDeuda() {
        return idDeuda;
    }

    public void setIdDeuda(DeudaCliente idDeuda) {
        this.idDeuda = idDeuda;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idMensualidad != null ? idMensualidad.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Mensualidad)) {
            return false;
        }
        Mensualidad other = (Mensualidad) object;
        if ((this.idMensualidad == null && other.idMensualidad != null) || (this.idMensualidad != null && !this.idMensualidad.equals(other.idMensualidad))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.jjsoft.celularessuc.gco.mdl.Mensualidad[ idMensualidad=" + idMensualidad + " ]";
    }
    
}
